လက်ရှိတည်နေရာ: ပင်မစာမျက်နှာ> ဖန်ရှင်အမျိုးအစားများ> property_exists

property_exists

အရာဝတ်ထုတစ်ခုသို့မဟုတ်အတန်းအစားသည်ဤပိုင်ဆိုင်မှုရှိ,
အမည်:property_exists
အမျိုးအစား:အတန်းများနှင့်အရာဝတ်ထု
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:အရာဝတ်ထုတစ်ခုသို့မဟုတ်အတန်းအစားသတ်မှတ်ထားသော attribute ကိုရှိမရှိစစ်ဆေးသည်

function name: Property_exists ()

function ကိုဖော်ပြချက်: Monthent_exists () function ကို) အရာဝတ်ထုတစ်ခုသို့မဟုတ်အတန်းအစားသည်သတ်မှတ်ထားသော attribute ကိုရှိမရှိစစ်ဆေးသည်။

Parametermer

  • $ အတန်းအစား: လိုအပ်သည်။ class name သို့မဟုတ် check လုပ်ထားရန်အရာဝတ်ထု။
  • $ အိမ်ခြံမြေ: လိုအပ်သည်။ စစ်ဆေးရန် attribute ကိုအမည်။

Value ကိုပြန်သွားပါ

  • ပစ္စည်းဥစ်စာပိုင်ဆိုင်မှုတည်ရှိပြီးလက်လှမ်းမီလျှင်စစ်မှန်သောပြန်လာ။
  • အကယ်. ပစ္စည်းဥစ်စာပိုင်ဆိုင်မှုမရှိပါကသို့မဟုတ်လက်လှမ်းမမီနိုင်ပါကမှားယွင်းစွာပြန်လာသည်။

သက်ဆိုင်သောဗားရှင်း - PHP 4, PHP 5, PHP 7

အသုံးပြုမှုဥပမာ -

  1. အတန်းအစားသတ်မှတ်ထားသော attribute ကိုရှိမရှိစစ်ဆေးပါ။
 class MyClass { public $name = "John"; private $age = 25; } $object = new MyClass(); if (property_exists($object, 'name')) { echo "The 'name' property exists."; } else { echo "The 'name' property does not exist."; } // 输出:The 'name' property exists.
  1. အရာဝတ်ထုတွင်သတ်မှတ်ထားသော attribute ကိုရှိ, မရှိစစ်ဆေးပါ။
 class MyClass { public $name = "John"; private $age = 25; } $object = new MyClass(); if (property_exists($object, 'age')) { echo "The 'age' property exists."; } else { echo "The 'age' property does not exist."; } // 输出:The 'age' property does not exist.
  1. Class Name သည်သတ်မှတ်ထားသော static attribute ကိုရှိမရှိစစ်ဆေးပါ။
 class MyClass { public static $name = "John"; private static $age = 25; } if (property_exists('MyClass', 'name')) { echo "The 'name' static property exists."; } else { echo "The 'name' static property does not exist."; } // 输出:The 'name' static property exists.
  1. အတန်းအစားအမည်မှာသတ်မှတ်ထားသော static private attribute ကိုရှိမရှိစစ်ဆေးပါ။
 class MyClass { public static $name = "John"; private static $age = 25; } if (property_exists('MyClass', 'age')) { echo "The 'age' static property exists."; } else { echo "The 'age' static property does not exist."; } // 输出:The 'age' static property does not exist.
သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • အရာဝတ်ထုသည်ဤအတန်းကို၎င်း၏မိဘအတန်းအစားတစ်ခုအဖြစ်ယူရန်သို့မဟုတ်အကောင်အထည်ဖော်ခြင်းရှိမရှိစစ်ဆေးသည်။ ဤအရာဝတ်ထုသည်အတန်း၏ subclass ဖြစ်သည် is_subclass_of

    is_subclass_of

    အရာဝတ်ထုသည်ဤအတန်းကို
  • သတ်မှတ်ထားသောအတန်းများ၏အမည်များ၏အမည်များကိုရေးစပ် get_declared_classes

    get_declared_classes

    သတ်မှတ်ထားသောအတန်းမျ
  • အရာဝတ်ထုရဲ့အတန်းအစားအမည်ကိုပြန်သွားပါ get_class

    get_class

    အရာဝတ်ထုရဲ့အတန်းအစား
  • အဆိုပါ interface ကိုသတ်မှတ်မရှိမရှိစစ်ဆေးပါ interface_exists

    interface_exists

    အဆိုပါinterfaceကိုသတ
  • သတ်မှတ်ထားသောရိုတည်ရှိရှိမရှိစစ်ဆေးပါ trait_exists

    trait_exists

    သတ်မှတ်ထားသောရိုတည်ရ
  • အရာဝတ်ထုသို့မဟုတ်အတန်းအစား၏မိဘအတန်းအစားအမည်ကိုပြန်လည်ရောက်ရှိ get_parent_class

    get_parent_class

    အရာဝတ်ထုသို့မဟုတ်အတန
  • အရာဝတ်ထုဂုဏ်သတ္တိများရေးထားသည့် assementive ခင်းကျင်းမှုကိုသင်ရေးရန်ပြန်သွားပါ get_object_vars

    get_object_vars

    အရာဝတ်ထုဂုဏ်သတ္တိမျာ
  • အားလုံးသတ်မှတ်ထားသောစရိုက်များအားလုံးတစ်ခုခင်းကျင်းပြန်လာ get_declared_traits

    get_declared_traits

    အားလုံးသတ်မှတ်ထားသော